<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<form:form commandName="model" cssClass="validate"
	action="project/costTemplate/save">
	<form:hidden path="id" />
	<table class=" form-table">
		<tbody>
			<tr>
				<td class="td1">父级：</td>
				<td class="td2"><form:input path="parentId" cssClass="hidden" />
					<isperp:treeSelector id="selectParentCostTemplate"
						url="project/costTemplate/getTree" valueControlId="parentId"
						displayValue="${parentName}" displayValueCssClass="required"></isperp:treeSelector>
				</td>
			</tr>
			<tr>
				<td class="td1">编码：</td>
				<td class="td2"><form:input path="code" cssClass="required" />
				</td>
			</tr>
			<tr>
				<td class="td1">科目名称：</td>
				<td class="td2"><form:input path="subjectName"
						cssClass="required" />
				</td>
			</tr>

			<tr>
				<td class="td1">名称：</td>
				<td class="td2"><form:input path="name" cssClass="" />
				</td>
			</tr>
			<tr>
				<td class="td1">固定费用：</td>
				<td class="td2"><form:checkbox path="fixAmount"
						onchange="fixAmountOnchange()" label="固定费用" />
				</td>
			</tr>
			<tr>
				<td class="td1">固定费用计算公式：</td>
				<td class="td2"><form:input path="calculateFormula"
						cssClass="hidden" cssStyle="width:80%" />
				</td>
			</tr>
			<tr>
				<td class="td1">是否展开：</td>
				<td class="td2"><form:checkbox path="open" /></td>
			</tr>
			<tr>
				<td class="td1">排序：</td>
				<td class="td2"><form:input path="orderNum" cssClass="number" />
				</td>
			</tr>
		</tbody>
	</table>
</form:form>

<script type="text/javascript">
	function fixAmountOnchange() {
		var result = $("#fixAmount1:checked").val();
		if (result) {
			$("#calculateFormula").prop("class", "required");
		} else {
			$("#calculateFormula").prop("class", "hidden");
		}

	}

	fixAmountOnchange();
</script>
<isperp:buttonList>
	<button class="submit" onclick="isperp.submitForm(); return false;">
		<span class="icon icon-save"></span>提交
	</button>
</isperp:buttonList>